import {   AIGC_UGC_SYSTEM_USER_KEY } from "@/utils/constant.js"
import LocalStorage from "@/utils/storage"

/***
 * 获取用户信息
 */
export function useUser(){
	const setUserInfo=(userInfo)=>{
		LocalStorage.set(AIGC_UGC_SYSTEM_USER_KEY,userInfo)
	}
	const getUserInfo=()=>{
		return new Promise((resolve,reject)=>{
			let SystemUserInfo=LocalStorage.read(AIGC_UGC_SYSTEM_USER_KEY);
			resolve(SystemUserInfo)
		})
	}
    
    return {
        setUserInfo,getUserInfo
    }
}